package com.infore.water.util;

/**
 * @author:wk
 * @date:Created in 9:13 2017\11\14 0014
 */
public class WaterLevelUtil {

    public static int  getProjectLevel(String projectName,Double value){
        if("溶解氧".equals(projectName)){
            if(value>=7.5){
                return 1;
            }else if(value>=6){
                return 2;
            }else if(value>=5){
                return 3;
            }else if(value>=3){
                return 4;
            }else if(value>=2){
                return 5;
            }else {
                return 6;
            }
        }else if("氨氮".equals(projectName)){
            if(value<=0.15){
                return 1;
            }else if(value<=0.50){
                return 2;
            }else if(value<=1.00){
                return 3;
            }else if(value<=1.50){
                return 4;
            }else if(value<=2.0){
                return 5;
            }else {
                return 6;
            }
        }else if("总磷".equals(projectName)){
            if(value<=0.02){
                return 1;
            }else if(value<=0.10){
                return 2;
            }else if(value<=0.20){
                return 3;
            }else if(value<=0.30){
                return 4;
            }else if(value<=0.40){
                return 5;
            }else {
                return 6;
            }
        }else if("总氮".equals(projectName)){
            if(value<=0.20){
                return 1;
            }else if(value<=0.50){
                return 2;
            }else if(value<=1.00){
                return 3;
            }else if(value<=1.50){
                return 4;
            }else if(value<=2.00){
                return 5;
            }else {
                return 6;
            }
        }else if("高锰酸盐指数".equals(projectName) || "CODmn".equals(projectName)){
            if(value<=2){
                return 1;
            }else if(value<=4){
                return 2;
            }else if(value<=6){
                return 3;
            }else if(value<=10){
                return 4;
            }else if(value<=15){
                return 5;
            }else {
                return 6;
            }
        }else if("化学需氧量".equals(projectName)||"CODcr".equals(projectName)){
            if(value<=15){
                return 1;
            }else if(value<=15){
                return 2;
            }else if(value<=20){
                return 3;
            }else if(value<=30){
                return 4;
            }else if(value<=40){
                return 5;
            }else {
                return 6;
            }
        }else if("铜".equals(projectName)){
            if(value<=0.01){
                return 1;
            }else if(value<=1.0){
                return 2;
            }else if(value<=1.0){
                return 3;
            }else if(value<=1.0){
                return 4;
            }else if(value<=1.0){
                return 5;
            }else {
                return 6;
            }
        }else if("锌".equals(projectName)){
            if(value<=0.05){
                return 1;
            }else if(value<=1.0){
                return 2;
            }else if(value<=1.0){
                return 3;
            }else if(value<=2.0){
                return 4;
            }else if(value<=2.0){
                return 5;
            }else {
                return 6;
            }
        }else if("氟化物".equals(projectName)){
            if(value<=1.0){
                return 1;
            }else if(value<=1.0){
                return 2;
            }else if(value<=1.0){
                return 3;
            }else if(value<=1.5){
                return 4;
            }else if(value<=1.5){
                return 5;
            }else {
                return 6;
            }
        }else if("硒".equals(projectName)){
            if(value<=0.01){
                return 1;
            }else if(value<=0.01){
                return 2;
            }else if(value<=0.01){
                return 3;
            }else if(value<=0.02){
                return 4;
            }else if(value<=0.02){
                return 5;
            }else {
                return 6;
            }
        }else if("砷".equals(projectName)){
            if(value<=0.05){
                return 1;
            }else if(value<=0.05){
                return 2;
            }else if(value<=0.05){
                return 3;
            }else if(value<=0.1){
                return 4;
            }else if(value<=0.1){
                return 5;
            }else {
                return 6;
            }
        }else if("汞".equals(projectName)){
            if(value<=0.00005){
                return 1;
            }else if(value<=0.00005){
                return 2;
            }else if(value<=0.0001){
                return 3;
            }else if(value<=0.001){
                return 4;
            }else if(value<=0.001){
                return 5;
            }else {
                return 6;
            }
        }else if("镉".equals(projectName)){
            if(value<=0.001){
                return 1;
            }else if(value<=0.005){
                return 2;
            }else if(value<=0.005){
                return 3;
            }else if(value<=0.005){
                return 4;
            }else if(value<=0.01){
                return 5;
            }else {
                return 6;
            }
        }else if("铬".equals(projectName)){
            if(value<=0.01){
                return 1;
            }else if(value<=0.05){
                return 2;
            }else if(value<=0.05){
                return 3;
            }else if(value<=0.05){
                return 4;
            }else if(value<=0.1){
                return 5;
            }else {
                return 6;
            }
        }else if("铅".equals(projectName)){
            if(value<=0.01){
                return 1;
            }else if(value<=0.01){
                return 2;
            }else if(value<=0.05){
                return 3;
            }else if(value<=0.05){
                return 4;
            }else if(value<=0.1){
                return 5;
            }else {
                return 6;
            }
        }else if("硫化物".equals(projectName)){
            if(value<=0.05){
                return 1;
            }else if(value<=0.1){
                return 2;
            }else if(value<=0.2){
                return 3;
            }else if(value<=0.5){
                return 4;
            }else if(value<=1){
                return 5;
            }else {
                return 6;
            }
        }else if("粪大肠菌群".equals(projectName)){
            if(value<=200){
                return 1;
            }else if(value<=2000){
                return 2;
            }else if(value<=10000){
                return 3;
            }else if(value<=20000){
                return 4;
            }else if(value<=40000){
                return 5;
            }else {
                return 6;
            }
        }else {
            return 1;
        }
    }
}
